<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<!-- saved from url=(0052)http://www.hz7hospital.com/yydj_zc.asp -->
<HTML xmlns="http://www.w3.org/1999/xhtml">
	<HEAD>
		<base href="<%=basePath%>" />
		<TITLE>${his.hospitalName}-注册</TITLE>
		<LINK rel=stylesheet type=text/css href="images/css.css">
		<script src="js/jquery.js" type="text/javascript"></script>
		<script src="js/date.js" type="text/javascript"></script>

		<SCRIPT language=javascript>
			
			
function verfifyEmail(strEmail){
var CheckMail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
 if (!CheckMail.test(strEmail))
 {
  return false;
 }else{
 return true;
 }
}


function isRegisterUserName(s) { 
	var patrn=/^[a-zA-Z]{1}([a-zA-Z0-9]|[._]){4,19}$/; 
	if (!patrn.exec(s)){ 
		return false; 
		}
		return true;
}

function isPasswd(s) { 
	var patrn=/^(\w){6,20}$/; 
	if (!patrn.exec(s)) 
		return false; 
	return true; 
} 


function      isTrueName(name)      //中文值检测
{  
if(name.length<2)
return      false;
for(i=0;i<name.length;i++){
if(name.charCodeAt(i) > 128)
return      true;
}
return      false;
}


function isPostalCode(s) { 	
	var patrn=/^[0-9]{1,20}$/;
	if (patrn.exec(s)){	
	if(s.length == 6) {
	return true;
	}
} 
		return false;
} 

            
        function verifyPhone(phone){  
       // var phone = document.getElementById("phone").value;  
        var tmp = /^1[3-9]\d{9}$/;     //支持11位手机号码验证  
        var flag=tmp.test(phone);  
        if(!flag){   
           return false;  
        }
        return true;  
}  
           
           

function doCheck(){
var userName = document.AddForm.uname.value; // 用户名
var pwd1 = document.AddForm.upass.value;	 // 密码
var pwd2 = document.AddForm.upass2.value;	 // 确认密码
var name = document.AddForm.urealname.value; // 姓名
var birth = document.AddForm.ubirth.value;	 // 生日
var email = document.AddForm.uemail.value;   // 邮箱
var zipCode = document.AddForm.uposs.value;  // 邮编
var phone = document.AddForm.uphone.value;   // 电话号码
var city = document.AddForm.lz_sf.value;   // 城市




if(!isRegisterUserName(userName)){
$("#unametip").html("用户名为5-20个以字母开头、可带数字“_” “.”的字符串");
return false;
}else{
$("#unametip").html("^_^");
 if(isRight==false){
	$("#unametip").html("用户名已存在");
	return false;
}
}

if(!isPasswd(pwd1)){
	$("#upwd1tip").css("color","red");
	$("#upwd1tip").html("只能是6-20个字母、数字、下划线");
	return false; 
}else{
	$("#upwd1tip").css("color","green");
	$("#upwd1tip").html("^ _ ^");
}

if (pwd1 != pwd2){
	$("#upwd2tip").text("两次输入的密码不一致，请重新输入！");
	return false;
}else{
$("#upwd2tip").text("");
}

if (!isTrueName(name)){
	$("#realnametip").text("请输入真实(中文)姓名！");
	return false;
}else {
	$("#realnametip").text("");
}

if (birth=="")
{$("#birthtip").text("请输入您的出生日期！");
return false;
}else {
$("#birthtip").text("");
}	


if(!verfifyEmail(email)){
$("#emailtip").text("请输入正确的e-mail地址!");
}else{
$("#emailtip").text("");
}


if (city=="请选择"){ 
$("#citytip").text("请选择城市！");
return false; 
}else {
$("#citytip").text("");
}

if (!isPostalCode(zipCode)){ 
$("#eposstip").text("请输入正确的6位数地区邮编！");
return false; 
}else {
$("#eposstip").text("");
}



if (verifyPhone(phone)){
 $("#phonetip").text("");
 }else{
$("#phonetip").text("请输入正确的手机号码！");
 return false
 }
	return true;
}
function res(){}
</SCRIPT>

		<SCRIPT LANGUAGE=JavaScript> 
var s=["s1","s2"]; 
var opt0 = ["请选择","请选择"]; 
function setup() 
{ 
for(i=0;i<s.length-1;i++) 
document.getElementById(s[i]).onchange=new Function("change("+(i+1)+")"); 
change(0); 
} 
//联动菜单结束
</SCRIPT>
		<script src="js/shengshi.js" type="text/javascript"></script>

		<META name=GENERATOR content="MSHTML 8.00.7600.16766">
	</HEAD>
	<BODY>
		<TABLE border=0 cellSpacing=0 cellPadding=0 width="783" align=center
			height="267">
			<TBODY>
				<TR>
					<TD height=61 vAlign=top align=left>
						<TABLE border=0 cellSpacing=0 cellPadding=0 width=779 height=61>
							<TBODY>
								<TR>
									<TD vAlign=top width=321 align=left>
										<img src="images/icon/${his.hospitalLogo}" />
									</TD>
									<TD vAlign=top align=right>
										<TABLE style="MARGIN-TOP: 31px; MARGIN-RIGHT: 5px" border=0
											cellSpacing=0 cellPadding=0>
											<TBODY>
												<TR>
													<TD vAlign=center align=right>
														·
														<A href="front/index.jsp">首页</A> ·
														<a href="front/userLogin.jsp">登录</a> ·
														<A href="connect.do?method=showConnect">联系我们</A>
													</TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
				<TR>
					<TD height=170 vAlign=top align=left>
						<TABLE border=0 cellSpacing=0 cellPadding=0 width=779 height=170>
							<TBODY>
								<TR>
									<TD>
										<OBJECT codeBase="#"
											classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=779
											height=170>
											<PARAM NAME="movie" VALUE="media/banner.swf">
											<PARAM NAME="quality" VALUE="high">
											<embed src="media/banner.swf" quality="high" pluginspage="#"
												type="application/x-shockwave-flash" width="779"
												height="170"></embed>
										</OBJECT>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>

			</TBODY>
		</TABLE>
		<TABLE style="MARGIN-TOP: 7px" border=0 cellSpacing=0 cellPadding=0
			width=779 align=center>
			<TBODY>
				<TR>
					<TD class=bgxz_zhong_bk bgColor=#f6f9fb vAlign=top width=197
						align=left>
						<jsp:include page="left.jsp"></jsp:include>
					</TD>
					<TD vAlign=top width=11 align=left>
						&nbsp;
					</TD>
					<TD class=bk vAlign=top width=567 align=left>
						<TABLE style="MARGIN-BOTTOM: 50px" border=0 cellSpacing=0
							cellPadding=0 width=567>
							<TBODY>
								<TR>
									<TD class=ind_zhong_bj bgColor=#ffffff height=28 vAlign=top
										align=right>
										<TABLE style="MARGIN-TOP: 4px; MARGIN-RIGHT: 10px" border=0
											cellSpacing=0 cellPadding=0 width=536>
											<TBODY>
												<TR>
													<TD vAlign=center align=left>
													</TD>
													<TD vAlign=center align=right>
														<A class=ztys_0B5596 href="#">首页</A><SPAN
															class=ztys_0B5596>－</SPAN><A class=ztys_0B5596>注册</A>
													</TD>
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>
								<TR>
									<TD bgColor=#ffffff vAlign=top align=left>
										<FORM method="post" name="AddForm"
											action="user.do?method=regedit">
											<TABLE style="MARGIN-TOP: 22px; MARGIN-LEFT: 61px"
												class=jyts_bk border=0 cellSpacing=0 cellPadding=0 width=445>
												<TBODY>
													<TR>
														<TD height=24 vAlign=bottom align=left>
															<TABLE style="MARGIN-LEFT: 10px" border=0 cellSpacing=0
																cellPadding=0>
																<TBODY>
																	<TR>
																		<TD vAlign=center align=left>
																			<P>
																				<FONT color=#ff0000>以下内容均须正确填写，否则可能会影响到你的预约信息！（带*号为必填项）</FONT>
																			</P>
																		</TD>
																	</TR>
																</TBODY>
															</TABLE>
														</TD>
													</TR>
													<TR>
														<TD vAlign=top align=middle>
															<SCRIPT language=javascript>   
															var isRight=false;
  function   check_click(){
  var userName = document.AddForm.uname.value; 
  if(userName=="")   
  {   
  userName.focus();   
  return   false;   
  } 
  if(!isRegisterUserName(userName)){
  $("#unametip").css("color","red");
$("#unametip").html("用户名为5-20个以字母开头、可带数字“_” “.”的字符串");
return false;
}else{
$("#unametip").html("<INPUT onclick=javascript:check_click(this) value=检测用户名 type=button name=checkuser>");

  $.getJSON("user.do?method=checkUserName",{uname:userName,suiji:Math.random()},function(data){
		  if(data=="该用户名已存在"){
		  $("#unametip").css("color","red");
		  $("#unametip").html("该用户名已存在");
		  return false;
		  }
  		$("#unametip").css("color","green");
		$("#unametip").html("^ _ ^");
		isRight=true;
  		return true;
  }); 
  }  
  }   
  </SCRIPT>

															<TABLE border=0 cellSpacing=1 cellPadding=0 width=431
																bgColor=#9bc8eb>
																<TBODY>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			用户名
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=18 type=text name=uname
																				onblur="check_click(this)">
																			<div id="unametip"
																				style="color: red; display: inline">

																			</div>
																		</TD>
																	</TR>

																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			登录密码
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=19 type=password
																				name=upass>
																			<div id="upwd1tip"
																				style="color: gray; display: inline">
																				(6位以上)
																			</div>
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			确认密码
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=19 type=password
																				name=upass2>
																			<div id="upwd2tip"
																				style="color: red; display: inline">
																			</div>
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			真实姓名
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=18 type=text
																				name=urealname>
																			<div id="realnametip"
																				style="color: red; display: inline" />
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			性 别
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<input type="radio" name="sex" value="男"
																				checked="checked" />
																			男
																			<input type="radio" name="sex" value="女" />
																			女
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			出生日期
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=18 type=text name=ubirth
																				readonly="readonly" onfocus=HS_setDate(this)>
																			<div id="birthtip"
																				style="color: red; display: inline" />
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			电子邮件
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 size=18 type=text name=uemail>
																			<div id="emailtip"
																				style="color: red; display: inline" />
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			所在城市
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<select name="lz_sf" id="s1">
																				<option></option>
																			</select>
																			<select name=uaddress id="s2">
																				<option></option>
																			</select>
																			<div id="citytip" style="color: red; display: inline" />
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=33
																			vAlign=center width=80 align=right>
																			邮政编码
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=33
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT class=jyts_bk2 maxlength="6" size=18 type=text
																				name=uposs id="youbian">
																			<div id="eposstip"
																				style="color: red; display: inline" />
																		</TD>
																	</TR>
																	<TR>
																		<TD class=jj_r_5 bgColor=#eefbfe height=47
																			vAlign=center width=80 align=right>
																			手机号码
																			<FONT color=#ff0000>*</FONT>
																		</TD>
																		<TD class=jj_l_5 bgColor=#eefbfe height=47
																			vAlign=center width=341 colSpan=2 align=left>
																			<INPUT maxlength="11" size=18 type=text name=uphone
																				id="shouji">
																			<div id="phonetip"
																				style="color: red; display: inline" />
																				<BR>
																				<FONT color=#ff0000>专家排班临时变动，用于及时进行通知</FONT>
																		</TD>
																	</TR>
																</TBODY>
															</TABLE>
														</TD>
													</TR>
													<TR>
														<TD height=41 vAlign=center align=middle>
															<TABLE border=0 cellSpacing=0 cellPadding=0 width=122>
																<TBODY>
																	<TR>
																		<TD align=left>
																			<INPUT border=0 src="images/jyts_07.gif" width=47
																				height=20 type=image onclick="return doCheck()">
																		</TD>
																		<TD align=right>
																		</TD>
																	</TR>
																</TBODY>
															</TABLE>
														</TD>
													</TR>
												</TBODY>
											</TABLE>
										</FORM>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
			</TBODY>
		</TABLE>
		<TABLE style="MARGIN-TOP: 13px" border=0 cellSpacing=0 cellPadding=0
			width=779 align=center height=114>
			<TBODY>
				<TR>
					<TD class=ind_bottom_bj height=29 vAlign=top align=middle>
						<TABLE style="MARGIN-TOP: 3px" border=0 cellSpacing=0
							cellPadding=0>
							<TBODY>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
				<TR>
					<TD height=85 vAlign=top align=middle>
						<TABLE style="MARGIN-TOP: 5px" border=0 cellSpacing=0
							cellPadding=0>
							<TBODY>
								<TR>
									<TD vAlign=center align=middle>
										<jsp:include page="yejiao.jsp"></jsp:include>
									</TD>
								</TR>
							</TBODY>
						</TABLE>
					</TD>
				</TR>
			</TBODY>
		</TABLE>
		<SCRIPT src="images/mystat.htm"></SCRIPT>
		<SCRIPT language="javascript"> 
setup();
</SCRIPT>
		<script type="text/javascript">
					$("#youbian").bind("keypress",function(){
						if ((event.keyCode<48 || event.keyCode>57)) event.returnValue=false
					});
					$("#shouji").bind("keypress",function(){
						if ((event.keyCode<48 || event.keyCode>57)) event.returnValue=false
					});
					$("#youbian").bind("keyup",function(){
						if(isNaN(this.value)){
							this.value="";
						}
					});
					$("#shouji").bind("keyup",function(){
						if(isNaN(this.value)){
							this.value="";
						}
					});
		</script>
	</BODY>
</HTML>


